﻿<!--#include file="mymin.asp"-->
<title>友链修改</title></head><body><div class='main400'>
<%
dim id,classs
id=request.Querystring("id")
classs=request.Querystring("class")
dim rs,sql,p
p=request.Querystring("p")
if p="" then p=1

set Rs=Server.CreateObject("ADODB.Recordset")
Sql="select * from 74hu_link Where ID="&ID
Rs.open Sql,myconn,1,3

if p=1 then
	classid=rs("classid")
%>
<form method="post" action="Edit_link.asp?sid=<%=sid%>&amp;class=<%=classs%>&amp;id=<%=id%>&amp;p=2">
友链名称:<input name="name" value="<%=nowml(rs("name"))%>" maxlength="7"/><br/>
友链简称:<input name="namt" value="<%=nowml(rs("namt"))%>" maxlength="4"/><br/>
网站地址:<input name="url" value="<%=nowml(rs("url"))%>"/><br/>
友链类别:<select name="classid"><%
	Set rss=Server.CreateObject("ADODB.Recordset")
	rss.open "select classid,class from 74hu_linkc",myconn,1,1
	While Not rss.eof
		classid2=rss("classid")
		w "<option value="""&classid2&""""
		if classid2=classid then w " selected"
		w ">"&nowml(rss("class"))&"</option>"
		rss.movenext
	Wend
	rss.close
	Set rss=Nothing
%></select><br/>
友链状态:<select name="active">
<option value="0">通过审核</option>
<option value="1"<% if rs("active")=1 Then w "selected"%>>等待审核</option>
</select><br/>
网站简介:<input name="jian" value="<%=nowml(rs("jian"))%>" maxlength="100"/><br/>
<input type="submit" value="修改友链"/>
</form>
<a href="mymin_class.asp?sid=<%=sid%>&amp;id=<%=classs%>&amp;p=2">[友链管理]</a><br/>
<a href="Link_class.asp?sid=<%=sid%>">[分类管理]</a><br/>
<a href='mymin_index.asp?sid=<%=sid%>'>[友链后台]</a>
<%elseif p=2 then
	dim name,namt,url,jian,brin,brout,active
	name=Request.Form("name")
	namt=Request.Form("namt")
	URL=Request.Form("URL")
	jian=Request.Form("jian")
	classid=Request.Form("classid")
	active=Request.Form("active")
	if classid="" Or IsNumeric(classid)=False then Call Error("友链类别不能为空！")
	if name="" then Call Error2("网站名称不能为空！")
	if namt="" then Call Error2("网站简称不能为空！")
	if len(namt)>4 then Call Error2("网站简称最多4字！")
	if url="" then Call Error2("网站地址不能为空！")
	If active<>"0" And active<>"1" Then active="1"
	if not (rs.bof and rs.eof) then
		rs("name")=name
		rs("namt")=namt
		rs("URL")=URL
		rs("jian")=jian
		rs("classid")=classid
		rs("active")=active
		rs.update()
		w "成功修改友链！<br/>"
	end if
%>
<a href="mymin_class.asp?sid=<%=sid%>&amp;id=<%=classs%>">[友链管理]</a><br/>
<a href="Link_class.asp?sid=<%=sid%>">[分类管理]</a><br/>
<a href='mymin_index.asp?sid=<%=sid%>'>[友链后台]</a>
<%END IF
call Last2%>